Skip to content

ARROW-6541: [Format][C++] Update Columnar.rst for two-part EOS, update C++ implementation#5361

Closed
wesm wants to merge 3 commits into
apache:ARROW-6313-flatbuffer-alignmentfrom
wesm:two-part-eos
Closed

ARROW-6541: [Format][C++] Update Columnar.rst for two-part EOS, update C++ implementation#5361
wesm wants to merge 3 commits into
apache:ARROW-6313-flatbuffer-alignmentfrom
wesm:two-part-eos

Conversation

@wesm

@wesm wesm commented Sep 11, 2019

Copy link
Copy Markdown
Member

No description provided.

@wesm wesm requested a review from emkornfield September 11, 2019 22:40

@eerhardt eerhardt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@wesm

wesm commented Sep 12, 2019

Copy link
Copy Markdown
Member Author

Trying to reproduce the failure that's occurring in Ursabot Python 2.7 build

@wesm

wesm commented Sep 12, 2019

Copy link
Copy Markdown
Member Author

I can repro, not sure why it occurs in Python 2.7 but not 3.6/7

@wesm

wesm commented Sep 12, 2019

Copy link
Copy Markdown
Member Author

@pitrou @emkornfield I found that Python 2.7 wasn't returning aligned memory from io.BytesIO and so I am making the metadata read path copy the metadata unconditionally if it is unaligned (even if the IPC format is implemented properly)

@BryanCutler BryanCutler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

namespace internal {

// This 0xFFFFFFFF value is the first 4 bytes of a valid IPC message
constexpr int32_t kIpcContinuationToken = -1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason i thought there were linkage issues in C++11 using constexpr in a header.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constexpr implies inline/static linkage. It's not an error (though I sort of expected it to be) in clang to declare

extern constexpr int32_t kIpcContinuationToken = -1;

... if you want to declare something constexpr within this translation unit but also export it as a symbol for other translation units, but the expectation is that you'll just include the header into whatever TU needs that constant.

@emkornfield emkornfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me, feel free to merge when build passes.

@pitrou

pitrou commented Sep 12, 2019

Copy link
Copy Markdown
Member

I found that Python 2.7 wasn't returning aligned memory from io.BytesIO

Interesting. Python 3 doesn't make any such guarantee either, but probably it turns out ok in the current bytes object implementation.

return Write(&kEos, sizeof(kEos));
constexpr int32_t kZeroLength = 0;
if (!options_.write_legacy_ipc_format) {
RETURN_NOT_OK(Write(&internal::kIpcContinuationToken, sizeof(int32_t)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
RETURN_NOT_OK(Write(&internal::kIpcContinuationToken, sizeof(int32_t)));
RETURN_NOT_OK(Write(&internal::kIpcContinuationToken, sizeof(internal::kIpcContinuationToken)));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to let this one slide -- I kind of prefer int32_t for the documentation aspect

wesm added a commit that referenced this pull request Sep 12, 2019
…e C++ implementation

Closes #5361 from wesm/two-part-eos and squashes the following commits:

cd632ff <Wes McKinney> Copy metadata unconditionally since input buffers may not start on aligned offsets
70d1b3a <Wes McKinney> Remove unneeded header
4071528 <Wes McKinney> Use 2-part EOS in C++, update in format docs. Write old EOS if option is set

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
@wesm wesm closed this Sep 12, 2019
wesm added a commit that referenced this pull request Sep 13, 2019
…e C++ implementation

Closes #5361 from wesm/two-part-eos and squashes the following commits:

cd632ff <Wes McKinney> Copy metadata unconditionally since input buffers may not start on aligned offsets
70d1b3a <Wes McKinney> Remove unneeded header
4071528 <Wes McKinney> Use 2-part EOS in C++, update in format docs. Write old EOS if option is set

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
pprudhvi pushed a commit to pprudhvi/arrow that referenced this pull request Sep 16, 2019
…e C++ implementation

Closes apache#5361 from wesm/two-part-eos and squashes the following commits:

cd632ff <Wes McKinney> Copy metadata unconditionally since input buffers may not start on aligned offsets
70d1b3a <Wes McKinney> Remove unneeded header
4071528 <Wes McKinney> Use 2-part EOS in C++, update in format docs. Write old EOS if option is set

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants